home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / kn / elate / exec / inittimer.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  512 b   |  36 lines

  1.  
  2. #include "tek/kn/elate/exec.h"
  3.  
  4. /* 
  5. **    TEKlib
  6. **    (C) 2001 TEK neoscientists
  7. **    all rights reserved.
  8. **
  9. **    TBOOL kn_inittimer(TKNOB *timer)
  10. **
  11. **    init kernel timer.
  12. **
  13. */
  14.  
  15. TBOOL kn_inittimer(TKNOB *timer)
  16. {
  17.     if (sizeof(TKNOB) >= sizeof(long))
  18.     {
  19.         *((long *) timer) = kn_time_get();
  20.         return TTRUE;
  21.     }
  22.     else
  23.     {
  24.         long *t = kn_alloc(sizeof(long));
  25.         if (t)
  26.         {
  27.             *t = kn_time_get();
  28.             *((long **) timer) = t;
  29.             return TTRUE;
  30.         }
  31.     }
  32.     
  33.     dbprintf("*** TEKLIB kernel: could not create timer\n");
  34.     return TFALSE;
  35. }
  36.